<%--
  Created by IntelliJ IDEA.
  User: Edward_yang
  Date: 2017/12/20 0020
  Time: 23:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<head>
    <title>产品审核</title>
</head>
<body>
<script>
    function checkProduct(){
        progressLoad();
        var productId=$("#productId").val();
        var productType=$("#productType").val()
        $.ajax({
            cache: true,
            type: "POST",
            url:"${path }/product/checkProduct.do",
            data:{"productType":productType,"productId":productId},
            async: false,
            error: function(request) {
                progressClose();
                $.messager.alert("删除失败", "服务器连接失败!","error");
            },
            success: function(data) {
                progressClose();
                if (data.success) {
                    $.messager.alert("系统提示", "操作成功","info",function(){
                        closeWin('modelCheckProduct');
                        reloadpProductDataGrid();
                    });

                }else{
                    progressClose();
                    $.messager.alert("系统提示", data.msg,"error");
                }
            }
        });
    }
</script>
<style>

    .table td{
        text-align: center;
        height:30px;
        border:1px solid #e0e0e0;
    }

</style>
<div data-options="region:'south',border:true">
    <table class="table">
        <tr>
            <td colspan="2" >审核产品</td>
        </tr>
        <tr >
            <td style="  background-color:  rgb(242,242,242);" >修改状态:</td>
            <td id="productInputs" style="width: 228px"><span>待审核:</span><input name="type" value="0" class="" type="radio" ><span>上架:</span><input name="type" value="1" class="" type="radio"> <span>下架:</span><input name="type" value="2" class="" type="radio"></td>
        </tr>
    </table>
    <input type="hidden" value="${product.id}" id="productId">
    <input type="hidden" value="${product.verifyType}" id="productType">
    <script type="text/javascript">
        $(function(){
            $("#productInputs input:eq(${product.verifyType})").attr("checked","checked");
            $("#productInputs input").on("change",function () {
                $("#productType").val($(this).val());
            });
        })
    </script>
</div>
<div  data-options="region:'south',border:true" style="height: 24px; padding-top: 8px;text-align: center" >
    <a class="easyui-linkbutton" icon="icon-save" onclick="checkProduct()" >保存</a>
    <a  class="easyui-linkbutton" icon="icon-cancel" onclick="closeWin('modelCheckProduct')" >取消</a>
</div>
</body>
</html>
